home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group93c.txt
/
000120_icon-group-sender _Wed Dec 15 20:16:46 1993.msg
< prev
next >
Wrap
Internet Message Format
|
1994-02-02
|
2KB
Received: by cheltenham.cs.arizona.edu; Wed, 15 Dec 1993 18:27:05 MST
Date: 15 Dec 93 20:16:46 GMT
From: agate!howland.reston.ans.net!news.moneng.mei.com!uwm.edu!fnnews.fnal.gov!fnalv.fnal.gov!mglass@ucbvax.Berkeley.EDU
Organization: Fermi National Accelerator Lab
Subject: Problem for icon mavens
Message-Id: <1993Dec15.141646.1@fnalo.fnal.gov>
Sender: icon-group-request@cs.arizona.edu
To: icon-group@cs.arizona.edu
Status: R
Errors-To: icon-group-errors@cs.arizona.edu
A question for icon mavens.
If you have a list of numbers "L" and a limit "lim", the
the following will produce all numbers from L which are less
than the limit:
suspend lim > !L
If L happens to be sorted, and quite long, you might want
to improve the process so it does not search the entire list.
An easy way is:
every x := !L do {
if x < lim then
suspend x
else
break
}
However in my application I have found that each iteration is
so slow, and "lim" is often large enough, that the easy way is not
much improved (on average) over the simple "suspend lim > !L."
Where "binary_search(L, lim)" does the obvious, I have actually
obtained better results with:
suspend !L[1+:binary_search(L, lim)]
So, icon mavens: What is the clever generation expression which
mimics "suspend lim > !L" without actually scanning all of L?
-- Michael Glass | Recently not spotted on a bumper sticker:
mglass@fnalv.fnal.gov | "I'd rather be grading"